var mysql = require('mysql');

var connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: '123456',
    // database: 'screenDB',
    // host: '202.197.66.62',
    // user: 'root',
    // password: '123456',
    // database: 'screenDB',
    // port:'20519'
    // port: ''
});

connection.connect();

var sql = 'create database if not exists screenDB default character set utf8 collate utf8_general_ci';
connection.query(sql,(err,results)=>{
    if(err) throw err
    console.log('create database')
})

connection.query('use screenDB', function (error, results, fields) {
    if (error) throw error;
    // console.log('The solution is: ', results[0].solution);
});

module.exports = connection;